package com.eduction.service.impl;

import java.sql.SQLException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eduction.bean.SchoolBean;
import com.eduction.modules.system.dao.SystemDao;
import com.eduction.modules.system.entity.School;
import com.eduction.service.ILoginService;
@Service
public class LoginServieImpl implements ILoginService{
	@Autowired
	private SystemDao systemDao;
	@Override
	public SchoolBean getSchoo(String sid,String pass) throws SQLException {
		// TODO Auto-generated method stub
		School schoolEntity = systemDao.getSchool(sid, pass);
		SchoolBean sBean = null;
		if(null!=schoolEntity){
			sBean = new SchoolBean();
			sBean.setId(schoolEntity.getP_id());
			sBean.setName(schoolEntity.getS_name());
			sBean.setCityName(systemDao.getCityById(schoolEntity.getP_city_id()).getS_name());
		}
		
		return sBean;
	}

}
